<h1 class="page-header">
    <small>修改密码</small>
</h1>
<hr/>
<div class="panel panel-inverse" data-sortable-id="form-stuff-1">
    <div class="panel-heading">
        <h4 class="panel-title">修改密码</h4>
    </div>
    <div class="panel-body">
        <form class="form-horizontal" id="accountForm" name="accountForm" action="${rc.contextPath}/user/editpwd" method="post">

            <div class="form-group">
                <label class="col-md-3 control-label">账户密码</label>

                <div class="col-md-9">
                    <input type="password" id="password" class="form-control" name="password" value=""
                           placeholder="密码 6-12位" rangelength="6,12" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-3 control-label">确认密码</label>

                <div class="col-md-9">
                    <input type="password" id="confirmPassword" class="form-control" name="confirmPassword" value=""
                           placeholder="密码 6-12位" rangelength="6,12" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-3 control-label"></label>

                <div class="col-md-9">
                    <button type="button" id="submitButton" class="btn btn-sm btn-success">提交</button>
                </div>
            </div>
        </form>
    </div>
</div>
<script type="application/javascript">

    $(function () {

        $('#submitButton').click(function () {
            $('#accountForm').submit();
        })

        $('#accountForm').validate({
            rules: {
                confirmPassword: {
                    equalTo: "#password"
                }
            },
            messages: {
                password: {
                    rangelength: "长度为6-12的字母\\数字\\下划线"
                }
            },
            errorPlacement: function (error, element) {
                error.appendTo(element.parent());
            }
        })
    })
</script>

